package com.calefk.core {
	
	import com.calefk.core.ClassBase;
	import com.calefk.util.TimerCustom;
	
	public class Task extends ClassBase {
		
		private var mTimerCustom:TimerCustom;
		
		public function Task(functionExec:Function , delay:int) {
			mTimerCustom = new TimerCustom(functionExec , 1 , delay);
			mTimerCustom.start();
		}
		
		override public function update(dt:int):void {
			if (mTimerCustom) {
				if (mTimerCustom.isStop) {
					toClean = true;
				} else {
					mTimerCustom.update(dt);
				}
			}
		}
		
		override public function clean():void {
			if (mTimerCustom) {
				mTimerCustom.clean();
				mTimerCustom = null;
			}
		}
	}
}